﻿namespace AlgLrnLib
{
    public class BaseActions
    {
        #region Delegates
        public delegate void DebugTraceDelegate(int[] numbers, string notes, bool withClear);
        #endregion

        #region Public Methods
        public void SwapByIndex(int[] numbers, int i, int j)
        {
            numbers[i] = numbers[i] ^ numbers[j];
            numbers[j] = numbers[j] ^ numbers[i];
            numbers[i] = numbers[i] ^ numbers[j];
        }

        public bool Compare(int a, int b, bool asc = true)
        {
            return asc == true ? a < b : a > b;
        }
        #endregion
    }
}
